package cc.co.cutenimy.nimyexplore.rcp.wizards;

import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.ui.INewWizard;
import org.eclipse.ui.IWorkbench;

import cc.co.cutenimy.nimyexplore.rcp.ApplicationContext;

public class NewConnectionWizard extends Wizard implements INewWizard {
	public static final String NEWCONNECTIONWIZARD_DETAILS_PAGE_TITLE = "Connection";

	public NewConnectionWizard() {
	}

	public void init(IWorkbench workbench, IStructuredSelection selection) {

	}

	@Override
	public void addPages() {
		addPage(new NewConnectionWizardPage(NEWCONNECTIONWIZARD_DETAILS_PAGE_TITLE));
	}

	@Override
	public boolean performFinish() {
		NewConnectionWizardPage page = (NewConnectionWizardPage) getPage(NEWCONNECTIONWIZARD_DETAILS_PAGE_TITLE);
		ApplicationContext.get().add(page.assemble());
		return true;
	}

}
